//图片服务器配置
//var picUrl = "http://localhost:9393/orisper/page/images";
var picUrl = "";
//文档服务器配置
var docUrl = "";

var My = {

    /**
     * 无参数ajax
     * @param {Object} reqUrl
     * @param {Object} succCalback
     */
	ajax1: function(reqUrl, succCalback) {
		$.ajax({
			type: "post",
			url: reqUrl,
			success: function(data) {
				var json = eval('(' + data + ')');
				if(json.code == "200") {
					var index = eval('(' + json.data + ')');
					//alert(index);
					if(typeof(succCalback) != "undefined")
						succCalback(index);
				} else {
					alert(json.msg);
				}
			}
		});
	},
	/**
	 * 带参数ajax
	 * @param {Object} reqUrl
	 * @param {Object} params
	 * @param {Object} succCalback
	 */
	ajax2: function(reqUrl,params, succCalback) {
		$.ajax({
			type: "post",
			data: params,
			url: reqUrl,
			success: function(data) {
				var json = eval('(' + data + ')');
				if(json.code == "200") {
					var index = eval('(' + json.data + ')');
					//alert(index);
					if(typeof(succCalback) != "undefined")
						succCalback(index);
				} else {
					alert(json.msg);
				}
			}
		});
	}
}

function getQueryString(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
        return unescape(r[2]);
    }
    return null;
}